home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / npp / finddlg.cpp next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  1.8 KB  |  80 lines

  1. // finddlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #if (_WIN32_WCE <= 200) 
  6. // Backward compatibility for H/PC 1.0 and 2.0
  7. // For later versions, we use an improved implementation of the Find Dialog
  8. // in MFCCE.
  9. #include "np.h"
  10. #include "mainfrm.h"
  11. #include "npdoc.h"
  12. #include "npview.h"
  13. #include "finddlg.h"
  14.  
  15. #ifdef _DEBUG
  16. #undef THIS_FILE
  17. static char BASED_CODE THIS_FILE[] = __FILE__;
  18. #endif
  19.  
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CFindDlg dialog
  22.  
  23.  
  24. CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
  25.     : CDialog(CFindDlg::IDD, pParent)
  26. {
  27.     //{{AFX_DATA_INIT(CFindDlg)
  28.     m_bMatchCase = FALSE;
  29.     m_szText = _T("");
  30.     m_nDirection = 1; // down by default
  31.     //}}AFX_DATA_INIT
  32. }
  33.  
  34.  
  35. void CFindDlg::DoDataExchange(CDataExchange* pDX)
  36. {
  37.     CDialog::DoDataExchange(pDX);
  38.     //{{AFX_DATA_MAP(CFindDlg)                         
  39.     DDX_Check(pDX, IDC_CHECK1, m_bMatchCase);
  40.     DDX_Radio(pDX, IDC_RADIO1, m_nDirection);
  41.     DDX_Text(pDX,  IDC_EDIT1,  m_szText);
  42.     //}}AFX_DATA_MAP
  43. }
  44.  
  45.  
  46. BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
  47.     //{{AFX_MSG_MAP(CFindDlg)
  48.     ON_BN_CLICKED(ID_EDIT_FIND_NEXT, OnEditFindNext)
  49.     //}}AFX_MSG_MAP
  50. END_MESSAGE_MAP()
  51.  
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CFindDlg message handlers
  55.  
  56. void CFindDlg::OnEditFindNext() 
  57. {
  58.     // the user selected to search. see if there is a search pattern in the edit control 
  59.     // using the default data exchange. 
  60.     // if no search string is present, keep the dialog box up.
  61.     UpdateData(TRUE);
  62.  
  63.     if (!m_szText.GetLength())
  64.     {
  65.         MessageBeep(MB_ICONEXCLAMATION);
  66.         return ;
  67.     }
  68.  
  69.     EndDialog(TRUE);
  70. }
  71.  
  72. BOOL CFindDlg::OnInitDialog() 
  73. {
  74.     CDialog::OnInitDialog();
  75.     return TRUE;  // return TRUE unless you set the focus to a control
  76.                   // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. #endif // _WIN32_WCE <= 200
  79.  
  80.